package Interfaz;

import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class PanelImagen extends JPanel
{

	//---------------------------------------------
	//ATRIBUTOS
	//---------------------------------------------
	
	private ImageIcon imagen;
	private JLabel labImagen;
	private JLabel labFM;
	private JLabel labAM;
	
	
	//---------------------------------------------
	//CONSTRUCTOR
	//---------------------------------------------
	
	public PanelImagen()
	{
		imagen = new ImageIcon("data/imagen.jpg");
		labImagen = new JLabel(imagen);
		labAM = new JLabel(" AM");
		labFM = new JLabel(" FM");
		
		labFM.setBackground(Color.WHITE);
		labFM.setForeground(Color.MAGENTA);
		labFM.setFont( new Font( "Comic Sans MS", Font.BOLD, 32 ) );
		
		labAM.setBackground(Color.WHITE);
		labAM.setForeground(Color.MAGENTA);
		labAM.setFont( new Font( "Comic Sans MS", Font.BOLD, 32 ) );
		
		setLayout(new GridLayout (1, 3));
		add(labAM);
		add(labImagen);
		add(labFM);
		
		setBackground(Color.WHITE);
	}
	//---------------------------------------------
	//METODOS
	//---------------------------------------------
	public void cambiarEtiquetas(String frecuencia)
	{
		if(frecuencia.equals("fm"))
		{
			labAM.setVisible(false);
			labFM.setVisible(true);
		}
		if(frecuencia.equals("am"))
		{
			labFM.setVisible(false);
			labAM.setVisible(true);
		}
			
	}

}
